Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify batch_ops() #1492

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Simplify batch_ops() #1492

merged 2 commits into from
Sep 12, 2024

Conversation

plafer
Copy link
Contributor

@plafer plafer commented Sep 11, 2024

Small PR that simplifies batch_ops() by not returning redundant information (i.e. batch groups).

I also used Iterator::flat_map instead of winter_utils::flatten_slice_elements since it's more canonical, and doesn't affect performance (blake3 benchmark). I also wouldn't be surprised if it compiled down to the same code after compiler optimizations.

@plafer plafer added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Sep 11, 2024
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left one small comment inline.

I also used Iterator::flat_map instead of winter_utils::flatten_slice_elements since it's more canonical, and doesn't affect performance (blake3 benchmark).

I'm not sure the blake3 benchmark is applicable here. this benchmark is dominated by the prover time, but this change mostly impacts instantiation of basic blocks which happens both during assembly and deserialization. I wonder if the compilation benchmark we have in the stdlib crate is more applicable here.

core/src/mast/node/basic_block_node/mod.rs Outdated Show resolved Hide resolved
@plafer
Copy link
Contributor Author

plafer commented Sep 11, 2024

I'm not sure the blake3 benchmark is applicable here. this benchmark is dominated by the prover time, but this change mostly impacts instantiation of basic blocks which happens both during assembly and deserialization. I wonder if the compilation benchmark we have in the stdlib crate is more applicable here.

Ah yes good point. I ran that benchmark, and it is also unchanged.

@plafer plafer merged commit 492ce81 into next Sep 12, 2024
9 checks passed
@plafer plafer deleted the plafer-batch-ops-simplification branch September 12, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This PR does not require an entry in the `CHANGELOG.md` file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants